/*
 * (C) 2012	Sheng Yi
 * Obtain if child becomes background process when parent process exits 
 */
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>

int main()
{
	pid_t pid;
	if ((pid = fork()) < 0)
		printf("fork error\n");
	else if (pid == 0)	/* child */
	{
		sleep(5);
		exit(0);
	}
	else	/* parent */
		exit(0);
	return 0;
}
